/*
 * Copyright (C) 2011 Andreas Petersson
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package at.petersson.interner;

/**
 * Created by IntelliJ IDEA.
 * User: Andreas
 * Date: 21.03.12
 * Time: 19:31
 * To change this template use File | Settings | File Templates.
 */
@Immutable
public class FunnyObj {
    private final int i;
    private final String k1;

    public FunnyObj(int i, String k1) {
        this.i = i;
        this.k1 = k1;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FunnyObj funnyObj = (FunnyObj) o;

        if (i != funnyObj.i) return false;
        if (k1 != null ? !k1.equals(funnyObj.k1) : funnyObj.k1 != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = i;
        result = 31 * result + (k1 != null ? k1.hashCode() : 0);
        return result;
    }
}
